/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 导入操作标记
 *
 * @author hxloongs
 * @date 2024-8-15
 */
@AllArgsConstructor
@Getter
public enum ImportOperationTagsEnum {
    WAIT_FLAG(1, "待标记"),
    ABLE_IMPORT(2, "可导入"),
    NOT_IMPORT(3, "不导入"),
    UPDATED(4, "已修改");
    private final Integer value;
    private final String desc;

    public static String getDescByValue(Integer value) {
        ImportOperationTagsEnum fileParsingStatusEnum = forValue(value);
        if (fileParsingStatusEnum == null) {
            return null;
        }
        return fileParsingStatusEnum.getDesc();
    }

    public static ImportOperationTagsEnum forValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (ImportOperationTagsEnum fileParsingStatusEnum : ImportOperationTagsEnum.values()) {
            if (fileParsingStatusEnum.getValue().equals(value)) {
                return fileParsingStatusEnum;
            }
        }
        return null;
    }

    public static ImportOperationTagsEnum forDesc(String desc) {
        if (desc == null) {
            return null;
        }
        for (ImportOperationTagsEnum fileParsingStatusEnum : ImportOperationTagsEnum.values()) {
            if (desc.equals(fileParsingStatusEnum.getDesc())) {
                return fileParsingStatusEnum;
            }
        }
        return null;
    }
}
